import request from '@/utils/request'

export function getRoutes() {
  return request({
    url: '/vue-element-admin/routes',
    method: 'get'
  })
}

export function getRoles() {
  return request({
    url: '/vue-element-admin/roles',
    method: 'get'
  })
}

export function addRole(data) {
  return request({
    url: '/vue-element-admin/role',
    method: 'post',
    data
  })
}

export function updateRole(id, data) {
  return request({
    url: `/vue-element-admin/role/${id}`,
    method: 'put',
    data
  })
}

export function deleteRole(id) {
  return request({
    url: `/vue-element-admin/role/${id}`,
    method: 'delete'
  })
}

// 下面是角色

// 创建角色
export function add(data) {
  return request({
    url: '/role/add',
    method: 'post',
    data
  })
}

export function edits(data) {
  return request({
    url: '/role/edit',
    method: 'post',
    data
  })
}

// 查询接口
export function getquery(data) {
  return request({
    url: '/role/getquery',
    method: 'post',
    data
  })
}
// 删除
export function deletes(data) {
  return request({
    url: '/role/deletes',
    method: 'post',
    data
  })
}

// 查询单条的
export function getid(data) {
  return request({
    url: '/role/getid',
    method: 'post',
    data
  })
}
